package com.lanou.timeline.reply.web.controller;

import com.lanou.timeline.reply.entity.TimelineReply;
import com.lanou.timeline.reply.service.impl.TimelineReplyServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/timelinereply")
public class TimelineReplyController {
    @Autowired
    private TimelineReplyServiceImpl timelineReplyServiceImpl;

    /**
     * 回复评论
     */
    @PostMapping("/replycomment")
    public void replyComment(TimelineReply timelineReply){
        timelineReplyServiceImpl.replyComment(timelineReply);
    }
    /**
     * 展示所有回复
     */
    @GetMapping("/showreply")
    public List<TimelineReply> showReply(String tagCommentId){
        return timelineReplyServiceImpl.showReply(tagCommentId);
    }
    /**
     * 对回复操作
     */
    @GetMapping("/operareply")
    public void operaReply(String timelineReplyId,Integer uid){
        timelineReplyServiceImpl.operaReply(timelineReplyId,uid);
    }
}
